home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
BOZOL2.ZIP
/
BOZOL.REF
< prev
next >
Wrap
Text File
|
1994-02-08
|
14KB
|
388 lines
>>> ASC - function to return the ascii code of an argument
Example: PRINT "The ASCII code of A is" ASC "A"
>>> ASCII - function to return the ascii code of an argument
Same as ASC
>>> BE - Placeholder for syntax. This command does nothing
Placeholders are dummy commands that help make the syntax more
natural. You can use this, as well as other placeholders anywhere
in a statement and it will simply be ignored.
Example: LET X BE 1
>>> CALC - Calculates whatever expression follows.
This command performs the same function as EVAL, CASE, and WHAT.
BozoL will not automatically calculate arithmetic expressions in
a statement. If you said
PRINT 1+1
BozoL will literally print "1+1". In order to evaluate an expression
you must use CALC, EVAL, CASE or WHAT before the expression. These
keywords can be intermixed and used multiple times in a statement.
There is no difference between the four of them. Having a choice
just makes the syntax easier to read and remember.
Example: PRINT CALC 1+1 (would print 2)
Example: IF EVAL A>B: GOSUB 10 (would jump to 10 if
IF CASE A=B: GOSUB 10 the expression is true)
Example: PRINT WHAT A+B IS (would print A+B. The
keyword IS is also a
placeholder and does
nothing)
>>> CASE - Calculates whatever expression follows.
Same as CALC
>>> CHR - Returns the character string of an ASCII code
Example: PRINT CHR 7
>>> CLS - Clears the screen
Example: IF finished:CLS:END
>>> COLOR - Sets the current color selection
Just like BASIC.
>>> CR - Returns a carriage return
Example: PRINT "Hello" CR CR CR "Goodbye!"
>>> END - Exits the BozoL interpreter.
End exits the subroutine PROGRUN and terminates the program.
>>> EQUAL - Placeholder for syntax. This command does nothing
LET and SET are used to assign values to variables. They only
need two arguments, the variable, and the value for it. Since
LET A B would be unclear, you can use a placeholder, such as
EQUAL to make the syntax a little more readable:
Example: LET A EQUAL B
>>> EQUALS - Tests two string values, returns true if they are the same
This function does not make for a readable syntax. It is identical
to the function SAME
Example: QUIT IF EQUALS UCASE INKEY "X" (quit if X is in keyboard)
Example: BE UNTIL NOT EQUALS INKEY "" (wait for a key to be pressed)
>>> EVAL - Calculates whatever expression follows.
Same as CALC
>>> FALSE - Returns a logical false (0)
Example: PRINT "Wheeeeeee" WHILE WHAT LEN INKEY = IS FALSE
>>> GOSUB - Jumps to a subroutine which terminates with RETURN
This works the same as BASIC's GOSUB statement. You can nest up
to 32 GOSUBs. GOSUB must be followed by a line number or a label.
Example: PRINT "Starting here"
GOSUB Middle
PRINT "Ending here!"
END
Middle:
PRINT "This is the middle!" : RETURN
>>> GOTO - Jumps to a line number or label.
This works just like the BASIC GOTO statement. You must be aware
that BozoL does not inherantly label line numbers, so unless you
are sure that the line number is not going to change (by adding
or deleting a line above it) you should use labels.
Example: PRINT "Starting here."
GOTO TheEnd
PRINT "Never gets here!"
TheEnd:
PRINT "This is the end!"
>>> IF - Test and expression and continue if true
This is similar to the BASIC IF statement, however it has some
strict limitations and differences. First, there is no THEN
statement. Simply follow IF with an expression and then a colon.
If the expression is true, the remainder of the line will be
executed. There is also no ELSE keyword.
Example: IF EVAL A=B: GOSUB 100
A second use for IF is to place the IF expression at the very
end of the line. If the expression is false, the preceeding
statements not separated by colons will be aborted.
Example: GOSUB 100 IF EVAL A=B
>>> IN - Placeholder for syntax. This command does nothing
Example: SAVE IN "TEST.PRG"
>>> INKEY - Returns next character in keyboard buffer, if any
INKEY does not pause. If one or more characters are waiting in
the keyboard buffer INKEY will return that character. If no
characters are waiting INKEY will return a null.
Example: BE UNTIL LEN INKEY
Remember that BE is just a placehoder. The expression
UNTIL LEN INKEY would work just the same.
>>> INPUT - Gets a line of input from the user into a variable
You can follow INPUT by a valid sequence of items to print.
The final parameter of INPUT must be a variable to contain the
input line after it has been typed. Unlike BASIC, the INPUT
expression may contain variables and functions.
Example: INPUT "What is your name? ",NAME
This would prompt the user (What is your name?) and then wait
while the user responds. When the user presses ENTER, the
response would be contained in the variable NAME. You can
use placeholders or a space to delimit this line.
Example: INPUT "What is your name? " TO NAME
>>> IS - Placeholder for syntax. This command does nothing
Example: GOTO 100 IF IS SAME A,B
>>> LCASE - Returns the lower case of an argument
Example: IF SAME LCASE INKEY,"y": END
>>> LEFT - Returns specified number of characters from left of string
Example: PRINT LEFT "Erik",3
This would print "Eri" on the screen. Not that a comma is also
just a placeholder and can be substituted with a space or a
semicolon.
>>> LEN - Returns the length of a string expression
Example: BE UNTIL LEN INKEY
This statement would loop until the length of INKEY was no longer
zero.
>>> LET - Assigns a value to a variable (same as SET)
Example: LET A EQUAL B
Note that you cannot use the equals sign (=) to assign a value
to a variable. The equals sign is only used in arithmetic
expressions to test whether one number is equal to another.
example: LET A BE EQUAL TO B
LET only requires two parameters, a varable and a value. You
can use placeholders, a comma, or just a space to separate them.
The above example is identical to LET A,B
>>> LIST - lists the program currently in memory to the screen
LIST by itself will type the whole program to the screen. LIST
followed by a line number will display that line. List followed
by two line numbers will display all of the numbers in between.
Example: LIST 1 TO 100
Note the placeholder TO. You could also just say LIST 1 100 or
LIST 1,100 and it would work the same.
>>> LOAD - Reads a program file from disk into memory.
Example: LOAD "TEST.PRG"
>>> LOCATE - Positions the cursor on the screen.
Example: LOCATE 10,10 : PRINT "Hi there!"
>>> LOWER - Returns the lower case of a string expression
Same as LCASE
>>> LTRIM - Trims leading spaces from a string